import {request} from '@/utils/request'
//base url
const BASE_URL = process.env.VUE_APP_API_BASE_URL
const api = {
    get_device_maintenance_plan_list  :'/device_maintenance/list_device_maintenance_plan',
    get_current_user_info:'/base_information/get_current_user_info',
    get_maintenance_plan_device_relation_list:'/device_maintenance/list_maintenance_plan_device_relation',
    get_warning_time_list:'/base_information/list_warning_time',
    save_device_maintenance_plan:'/device_maintenance/save_device_maintenance_plan',
    save_maintenance_plan_device_relation:'/device_maintenance/save_maintenance_plan_device_relation',
    delete_maintenance_plan_device_relation:'/device_maintenance/delete_maintenance_plan_device_relation',
    delete_device_maintenance_plan:'/device_maintenance/delete_device_maintenance_plan',
    list_device_maintenance_task_all:'/device_maintenance/list_device_maintenance_task_all',
    get_cache_by_vaguename:'/cache/get_cache_by_vaguename',
    save_device_maintenance_task:'/device_maintenance/save_device_maintenance_task',
    delete_device_maintenance_task:'/device_maintenance/delete_device_maintenance_task',
    list_device_maintenance_info_all:'/device_maintenance/list_device_maintenance_info_all',
    list_device_maintenance_task_by_user_id:'/device_maintenance/list_device_maintenance_task_by_user_id',
    get_cache_by_id:'/cache/get_cache_by_id',
    save_device_maintenance_info:'/device_maintenance/save_device_maintenance_info',
    save_device_maintenance_result:'/device_maintenance/save_device_maintenance_result',
    list_device_maintenance_result:'/device_maintenance/list_device_maintenance_result',
    delete_device_maintenance_info:'/device_maintenance/delete_device_maintenance_info'
}

for (const apiKey in api) {
    api[apiKey] = BASE_URL + api[apiKey];
}

export function delete_device_maintenance_info(parameter) {
    return request( api.delete_device_maintenance_info,
        'post',
        parameter,
        // { headers: parameter.headers }
    )
}

export function list_device_maintenance_result(parameter) {
    return request( api.list_device_maintenance_result,
        'get',
        parameter,
        // { headers: parameter.headers }
    )
}

export function save_device_maintenance_result(parameter) {
    return request( api.save_device_maintenance_result,
        'post',
        parameter,
        // { headers: parameter.headers }
    )
}

export function save_device_maintenance_info(parameter) {
    return request( api.save_device_maintenance_info,
        'post',
        parameter,
        // { headers: parameter.headers }
    )
}

export function get_cache_by_id(parameter) {
    return request( api.get_cache_by_id,
        'get',
        parameter,
        // { headers: parameter.headers }
    )
}

export function list_device_maintenance_task_by_user_id(parameter) {
    return request( api.list_device_maintenance_task_by_user_id,
        'get',
        parameter,
        // { headers: parameter.headers }
    )
}

export function list_device_maintenance_info_all(parameter) {
    return request( api.list_device_maintenance_info_all,
        'get',
        parameter,
        // { headers: parameter.headers }
    )
}

export function delete_device_maintenance_task(parameter) {
    return request( api.delete_device_maintenance_task,
        'post',
        parameter,
        // { headers: parameter.headers }
    )
}
export function save_device_maintenance_task(parameter) {
    return request( api.save_device_maintenance_task,
        'post',
        parameter,
        // { headers: parameter.headers }
    )
}
export function get_cache_by_vaguename2(parameter) {
    return request( api.get_cache_by_vaguename,
        'get',
        parameter,
        // { headers: parameter.headers }
    )
}

export function get_current_user_info(parameter) {
    return request( api.get_current_user_info,
        'get',
        parameter,
        // { headers: parameter.headers }
    )
}

export function list_device_maintenance_task_all(parameter) {
    return request( api.list_device_maintenance_task_all,
        'get',
        parameter,
        // { headers: parameter.headers }
    )
}

export function delete_device_maintenance_plan(parameter) {
    return request( api.delete_device_maintenance_plan,
        'post',
        parameter,
        // { headers: parameter.headers }
    )
}

export function delete_maintenance_plan_device_relation(parameter) {
    return request( api.delete_maintenance_plan_device_relation,
        'post',
        parameter,
        // { headers: parameter.headers }
    )
}
export function save_maintenance_plan_device_relation(parameter) {
    return request( api.save_maintenance_plan_device_relation,
        'post',
        parameter,
        // { headers: parameter.headers }
    )
}

export function save_device_maintenance_plan(parameter) {
    return request( api.save_device_maintenance_plan,
        'post',
        parameter,
        // { headers: parameter.headers }
    )
}
export function get_warning_time_list(parameter) {
    return request( api.get_warning_time_list,
        'get',
        parameter,
        // { headers: parameter.headers }
    )
}

export function get_maintenance_plan_device_relation_list(parameter) {
    return request( api.get_maintenance_plan_device_relation_list,
        'get',
        parameter,
        // { headers: parameter.headers }
    )
}
export function get_device_maintenance_plan_list(parameter) {
    return request( api.get_device_maintenance_plan_list,
        'get',
        parameter,
        // { headers: parameter.headers }
    )
}
//
